package com.tang.model.itrerator;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/3 21:41
 * @Desc
 * @Remarks
 */
public class CourseAggregateImpl implements ICourseAggregate {
    private List<Course> list;

    public CourseAggregateImpl() {
        list = new ArrayList();
    }

    @Override
    public void add(Course course) {
        list.add(course);
    }

    @Override
    public void remove(Course course) {
        list.remove(course);
    }

    @Override
    public TYIterator<Course> tyItrerator() {
        return new TYIteratorImpl<Course>(this.list);
    }
}
